package org.dromara.oce.domain.req;

import lombok.Data;
import org.dromara.oce.utils.DateTimeUtil;

import java.math.BigDecimal;

@Data
public class IaaOrderAmountHoursDTO {


    //@ApiModelProperty(value = "推广链接id")
    private Long referralLinkId;

    //@ApiModelProperty(value = "当日日期时间戳")
    private Long thatdayTimestamp;

    //@ApiModelProperty(value = "当日某时时间戳yyyy-mm-dd HH")
    private Long thatdayHoursTimestamp;
//    @ApiModelProperty(value = "当日某时时间")
    private String thatdayHoursDate;


    //@ApiModelProperty(value = "当日IAA总收入")
    private BigDecimal iaaTotalAmount = BigDecimal.ZERO;
    //@ApiModelProperty(value = "当日IAA分成金额")
    private BigDecimal iaaDividendAmount = BigDecimal.ZERO;
    //@ApiModelProperty(value = "当日注册用户的IAA总收入")
    private BigDecimal iaaRegisterTotalAmount = BigDecimal.ZERO;
    //@ApiModelProperty(value = "当日注册用户的IAA分成金额")
    private BigDecimal iaaRegisterDividendAmount = BigDecimal.ZERO;

    private BigDecimal iaaDividendAmountSw = BigDecimal.ZERO;
    private BigDecimal iaaRegisterDividendAmountSw = BigDecimal.ZERO;


    //@ApiModelProperty("当前时段的总金额")
    private BigDecimal amountHoursCurrent = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+1的总金额")
    private BigDecimal amountHoursOne = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+2的总金额")
    private BigDecimal amountHoursTwo = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+3的总金额")
    private BigDecimal amountHoursThree = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+4的总金额")
    private BigDecimal amountHoursFour = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+n的总金额")
    private BigDecimal amountHoursFive = BigDecimal.ZERO;


    //@ApiModelProperty("当前时段的分成金额")
    private BigDecimal dividendAmountHoursCurrent = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+1的分成金额")
    private BigDecimal dividendAmountHoursOne = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+2的分成金额")
    private BigDecimal dividendAmountHoursTwo = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+3的分成金额")
    private BigDecimal dividendAmountHoursThree = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+4的分成金额")
    private BigDecimal dividendAmountHoursFour = BigDecimal.ZERO;
    //@ApiModelProperty("当前时段+n的分成金额")
    private BigDecimal dividendAmountHoursFive = BigDecimal.ZERO;

//    /**
//     * 计算交易属于哪个T时段
//     * @param registerTimestamp
//     * @param payTimestamp
//     * @param dividendAmount
//     */
//    public void hoursBlockAddAmount(long registerTimestamp, long payTimestamp, BigDecimal dividendAmount) {
//        try {
//            registerTimestamp = DateTimeUtil.getHoursTimestamp(registerTimestamp);
//            payTimestamp = DateTimeUtil.getHoursTimestamp(payTimestamp);
//
//            int registerHours = DateTimeUtil.getHours(registerTimestamp);
//            int payHours = DateTimeUtil.getHours(payTimestamp);
//
//            long hoursNum = (payTimestamp - registerTimestamp) / 3600;
//            if (hoursNum == 0 && registerHours == payHours) {
//                this.dividendAmountHoursCurrent = this.dividendAmountHoursCurrent.add(dividendAmount);
//            } else if (hoursNum == 0) {
//                this.dividendAmountHoursOne = this.dividendAmountHoursCurrent.add(dividendAmount);
//            } else if (hoursNum == 1) {
//                this.dividendAmountHoursOne = this.dividendAmountHoursOne.add(dividendAmount);
//            } else if (hoursNum == 2) {
//                this.dividendAmountHoursTwo = this.dividendAmountHoursTwo.add(dividendAmount);
//            } else if (hoursNum == 3) {
//                this.dividendAmountHoursThree = this.dividendAmountHoursThree.add(dividendAmount);
//            } else if (hoursNum == 4) {
//                this.dividendAmountHoursFour = this.dividendAmountHoursFour.add(dividendAmount);
//            } else {
//                this.dividendAmountHoursFive = this.dividendAmountHoursFive.add(dividendAmount);
//            }
//        } catch (Exception e) {
//            System.out.println("计算时段分成金额异常");
//        }
//    }

}
